{eq name="isShow" value="1"}
<div class="form-inline" style="padding-bottom:10px;">
    <label class="checkbox-inline">
        <input type="checkbox" id="setPriceType" name="is_attr" value="1"> 开启规格属性
    </label>
    <div class="clearfix"></div>
</div>
<p class="help-block">销售价分一口价、阶梯价两种，阶梯价格式："1:8.8,5:6.6,10:3.3",可点击对应链接批量设置。</p>
<div id="attrList" style="display:none;">
    <div class="div_contentlist">
        {volist name="attrList" id="one" key="k"}
        <input type="hidden" name="attr[{$k-1}][attr_id]" value="{$one.attr_id}" />
        <input type="hidden" name="attr[{$k-1}][attr_name]" value="{$one.attr_name}" />
        <h4 class="Father_Title">
            {$one.attr_name}：
        </h4>
        <div class="Father_Item Father_Item{$k-1}">
            <label class="checkbox-inline">
                <input type="checkbox" class="checkboxItem check_all" value="全选"> 全选
            </label>
            {volist name="one.item_list" id="two"}
            <label class="checkbox-inline">
                <input type="checkbox" class="checkboxItem check_item" value="{$two.item_name}"> {$two.item_name}
            </label>
            {/volist}
        </div>
        <div class="clearfix"></div>
        {/volist}
    </div>
</div>
<div id="createTable"></div>
<script id="noAttrTable" type="text/html">
    <table class="table table-bordered attrTable">
        <thead>
        <tr>
            <th nowrap>规格</th>
            <th width="180">商品货号</th>
            <th width="110">库存 <a href="javascript:;" onclick="setVal(2)">设置</a></th>
            <th width="110">市场价 <a href="javascript:;" onclick="setVal(3)">设置</a></th>
            <th>销售价 <a href="javascript:;" onclick="setVal(4)">一口价</a> <a href="javascript:;" onclick="setPrice('/system/shop_goods/ladderprice.html')">阶梯价</a></th>
            <th width="110"><a href="javascript:;" onclick="setVal(5)">重量(g)</a></th>
            <th width="80"><a href="javascript:;" onclick="setVal(6)">起订量</a></th>
            <th width="80"><a href="javascript:;" onclick="setVal(7)">步长</a></th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>
                #<input name="sku[0][sku_name]" type="hidden" class="form-control input-sm" value="">
            </td>
            <td><input name="sku[0][sku_sn]" type="text" class="form-control input-sm" datatype="*" value="{:rand_number(8,1)}"></td>
            <td><input name="sku[0][goods_stock]" class="form-control input-sm" datatype="*" type="text" value="100"></td>
            <td><input name="sku[0][market_price]" class="form-control input-sm" datatype="*" type="text" value=""></td>
            <td><input name="sku[0][goods_price]" class="form-control input-sm" datatype="*" type="text" value=""></td>
            <td><input name="sku[0][goods_weight]" class="form-control input-sm" datatype="*" type="text" value="0" /></td>
            <td><input name="sku[0][minimum]" class="form-control input-sm" datatype="*" type="text" value="1" /></td>
            <td><input name="sku[0][step]" class="form-control input-sm" datatype="*" type="text" value="1" /></td>
        </tr>
        </tbody>
    </table>
</script>
<script>
    $(function(){
        $('#createTable').html(template('noAttrTable'));
        $('#setPriceType').on("click", function () {
            if ($(this).prop("checked")) {
                $('#createTable').html('');
                $('#attrList').show();
            } else {
                $('#createTable').html(template('noAttrTable'));
                $('#attrList').hide();
            }
        });
    });
</script>
{/eq}
<!--无SKU-->
{eq name="isShow" value="0"}
<p class="help-block">销售价分一口价、阶梯价两种，阶梯价格式："1:8.8,5:6.6,10:3.3",可点击对应链接批量设置。</p>
<table class="table table-bordered attrTable">
    <thead>
    <tr>
        <th nowrap>规格</th>
        <th width="180">商品货号</th>
        <th width="110">库存 <a href="javascript:;" onclick="setVal(2)">设置</a></th>
        <th width="110">市场价 <a href="javascript:;" onclick="setVal(3)">设置</a></th>
        <th>销售价 <a href="javascript:;" onclick="setVal(4)">一口价</a> <a href="javascript:;" onclick="setPrice('/system/shop_goods/ladderprice.html')">阶梯价</a></th>
        <th width="110">重量(g)  <a href="javascript:;" onclick="setVal(5)">设置</a></th>
        <th width="80"><a href="javascript:;" onclick="setVal(6)">起订量</a></th>
        <th width="80"><a href="javascript:;" onclick="setVal(7)">步长</a></th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>#
            <input name="sku[0][sku_name]" type="hidden" class="form-control input-sm" value="">
        </td>
        <td><input name="sku[0][sku_sn]" type="text" class="form-control input-sm" datatype="*" value="{:rand_number(8,1)}"></td>
        <td><input name="sku[0][goods_stock]" class="form-control input-sm" datatype="*" type="text" value="100"></td>
        <td><input name="sku[0][market_price]" class="form-control input-sm" datatype="*" type="text" value=""></td>
        <td><input name="sku[0][goods_price]" class="form-control input-sm" datatype="*" type="text" value=""></td>
        <td><input name="sku[0][goods_weight]" class="form-control input-sm" datatype="*" type="text" value="0" /></td>
        <td><input name="sku[0][minimum]" class="form-control input-sm" datatype="*" type="text" value="1" /></td>
        <td><input name="sku[0][step]" class="form-control input-sm" datatype="*" type="text" value="1" /></td>
    </tr>
    </tbody>
</table>
{/eq}